package com.ly.heart.service.impl;

import java.util.List;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import com.ly.common.utils.DateUtils;
import com.ly.common.utils.erp.SnowflakeIdWorker;
import com.ly.heart.domain.SurveyDataDictEntity;
import com.ly.heart.mapper.SurveyDataDictMapper;
import com.ly.heart.service.ISurveyDataDictService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 勘测屋顶资料收集关联屋顶类型、厂房性质、防水方式Service业务层处理
 * @author wutao
 * @date 2024-05-25
 */
@Service
public class SurveyDataDictServiceImpl extends ServiceImpl<SurveyDataDictMapper, SurveyDataDictEntity> implements ISurveyDataDictService {

    @Resource
    private SurveyDataDictMapper erpSurveyDataDictInfoMapper;

    /**
     * 查询勘测屋顶资料收集关联屋顶类型、厂房性质、防水方式
     * @param id 勘测屋顶资料收集关联屋顶类型、厂房性质、防水方式ID
     * @return 勘测屋顶资料收集关联屋顶类型、厂房性质、防水方式
     */
    @Override
    public SurveyDataDictEntity selectErpSurveyDataDictInfoById (String id) {
        return erpSurveyDataDictInfoMapper.selectErpSurveyDataDictInfoById ( id );
    }

    /**
     * 查询勘测屋顶资料收集关联屋顶类型、厂房性质、防水方式列表
     * @param erpSurveyDataDictInfo 勘测屋顶资料收集关联屋顶类型、厂房性质、防水方式
     * @return 勘测屋顶资料收集关联屋顶类型、厂房性质、防水方式
     */
    @Override
    public List<SurveyDataDictEntity> selectErpSurveyDataDictInfoList (SurveyDataDictEntity erpSurveyDataDictInfo) {
        return erpSurveyDataDictInfoMapper.selectErpSurveyDataDictInfoList ( erpSurveyDataDictInfo );
    }

    /**
     * 新增勘测屋顶资料收集关联屋顶类型、厂房性质、防水方式
     * @param erpSurveyDataDictInfo 勘测屋顶资料收集关联屋顶类型、厂房性质、防水方式
     * @return 结果
     */
    @Override
    public int insertErpSurveyDataDictInfo (SurveyDataDictEntity erpSurveyDataDictInfo) {
        erpSurveyDataDictInfo.setId ( SnowflakeIdWorker.getInstance ().nextStringId () );
        erpSurveyDataDictInfo.setCreateTime ( DateUtils.getNowDate () );
        return erpSurveyDataDictInfoMapper.insertErpSurveyDataDictInfo ( erpSurveyDataDictInfo );
    }

    /**
     * 修改勘测屋顶资料收集关联屋顶类型、厂房性质、防水方式
     * @param erpSurveyDataDictInfo 勘测屋顶资料收集关联屋顶类型、厂房性质、防水方式
     * @return 结果
     */
    @Override
    public int updateErpSurveyDataDictInfo (SurveyDataDictEntity erpSurveyDataDictInfo) {
        erpSurveyDataDictInfo.setUpdateTime ( DateUtils.getNowDate () );
        return erpSurveyDataDictInfoMapper.updateErpSurveyDataDictInfo ( erpSurveyDataDictInfo );
    }

    /**
     * 批量删除勘测屋顶资料收集关联屋顶类型、厂房性质、防水方式
     * @param ids 需要删除的勘测屋顶资料收集关联屋顶类型、厂房性质、防水方式ID
     * @return 结果
     */
    @Override
    public int deleteErpSurveyDataDictInfoByIds (String[] ids) {
        return erpSurveyDataDictInfoMapper.deleteErpSurveyDataDictInfoByIds ( ids );
    }

    /**
     * 删除勘测屋顶资料收集关联屋顶类型、厂房性质、防水方式信息
     * @param id 勘测屋顶资料收集关联屋顶类型、厂房性质、防水方式ID
     * @return 结果
     */
    @Override
    public int deleteErpSurveyDataDictInfoById (String id) {
        return erpSurveyDataDictInfoMapper.deleteErpSurveyDataDictInfoById ( id );
    }
}
